Structures

Structures can now be defined with methods.


(define-structure-type typename {components}tex2html_wrap_inline$^+$ {methods}*) $\Longrightarrow$ stype syntax

typename and components are handled as before. methods is an optional list of method clauses. For example,

formula vobeyspaces :
!:} (define-structure-type employee name age salary (((human? self) t) ((print self stream) (format stream "#{Employee ( a) a}" (object-hash self) (employee-name self)))))

The methods in the methods clauses cannot reference the components directly. They must use the standard structure accessors. For example, in the print method above the name component of the employee structure must be accessed as (employee-name self) not as name.

Structures cannot yet be joined to other objects.